<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLogVipRanksTable extends Migration
{
    /**
     * Run the migrations.
     * vip充值排行.
     */
    public function up()
    {
        Schema::create('log_vip_ranks', function (Blueprint $table) {
            $table->increments('id');
            $table->tinyInteger('type')->comment('类型:1全服,2渠道');
            $table->integer('server_id')->default(0)->comment('区服ID');
            $table->integer('channel_id')->default(0)->comment('渠道ID');
            $table->bigInteger('role_id')->comment('角色id');
            $table->string('name', '50')->comment('角色名');
            $table->string('vip_level', 30)->comment('vip等级');
            $table->bigInteger('military')->comment('战力');
            $table->tinyInteger('profession')->comment('职业');
            $table->integer('amount')->default(0)->comment('充值金额');
            $table->integer('no_pay_days')->default(0)->comment('未充值天数');
            $table->dateTime('last_pay_time')->nullable()->comment('最近充值时间');
            $table->smallInteger('no_login_days')->default(0)->comment('未登录天数');
            $table->dateTime('last_login_time')->nullable()->comment('最后登录时间');
            $table->bigInteger('surplus_gold')->comment('剩余元宝');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('log_vip_ranks');
    }
}
